﻿#pragma once
// CTitleWnd 窗体视图
#include "public\\cdib.h"

class CServerSocket;
class CWitsSocket;
class CClientSocket;

class CTitleWnd : public CFormView
{
	DECLARE_DYNCREATE(CTitleWnd)

public:
	CTitleWnd();           // 动态创建所使用的受保护的构造函数
	virtual ~CTitleWnd();

public:
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_CTitleWnd };
#endif
#ifdef _DEBUG
	virtual void AssertValid() const;
#ifndef _WIN32_WCE
	virtual void Dump(CDumpContext& dc) const;
#endif
#endif

private:
	int		m_nTimer;
	CRect  m_DateRect;
	CDib	m_dibCNPC;				//CNPC
	CRect	m_rtCNPC;
	CRect	m_rtCompany;
	CString m_strWN;

	void	Draw(CDC* pDC);
	//WITS输出
public:
	CServerSocket*	m_pServerSocket;
	CPtrList m_connectionList;
	void ProcessPendingAccept();
	void SendWits();
	void StartWitsOut();
	void CloseWitsOutClient(CClientSocket* pSocket);

private:
	//WITS输入
	CWitsSocket*  m_pWitsInSocket;
	void OnConnectDLS();

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	virtual void OnDraw(CDC* pSDC);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
};


